<h2><?php  __('Manage unit: '.$cdeUnit['CdeUnit']['title']);?></h2>

<p><?php echo $cdeUnit['CdeUnit']['description']; ?></p>

<table class="list">
<tr>
	<th>Module title</th>
	<th>Description</th>
	<th class="checkbox">Enabled</th>
	<th class="actions"><?php __('Actions');?>&nbsp;|&nbsp;<?php echo $html->link(__('Add new module', true), array('action'=>'../cde_modules/add', $cdeUnit['CdeUnit']['id'])); ?></th>
</tr>
<?php
$i = 0;
foreach ($cdeModules as $cdeModule):
	$class = null;
	if ($i++ % 2 == 0) {
		$class = ' class="altrow"';
	}
?>
	<tr<?php echo $class;?>>
		<td>
			<?php echo $cdeModule['CdeModule']['title']; ?>
		</td>
		<td>
			<?php echo $cdeModule['CdeModule']['description']; ?>
		</td>
		<td class="checkbox">
			<input type="checkbox" <?php if ($cdeModule['CdeModule']['enabled']) echo "checked='checked'"; ?> disabled='disabled' />
		</td>
		<td class="actions">
			<?php echo $html->link(__('Update', true), array('action'=>'../cde_modules/edit', $cdeModule['CdeModule']['id'])); ?>&nbsp;&nbsp;|&nbsp;&nbsp;
			<?php echo $html->link(__('Delete', true), array('action'=>'../cde_modules/delete', $cdeModule['CdeModule']['id']), null, sprintf(__('Are you sure you want to delete module "%s"?', true), $cdeModule['CdeModule']['title'])); ?>&nbsp;&nbsp;|&nbsp;&nbsp;
			<?php echo $html->link(__('Manage', true), array('action'=>'../cde_modules/manage', $cdeModule['CdeModule']['id'])); ?>&nbsp;&nbsp;|&nbsp;&nbsp;
			<?php
				if ($cdeModule['CdeModule']['enabled'])
				{
					echo $html->link(__('Disable', true), array('action'=>'../cde_modules/disable', $cdeModule['CdeModule']['id']));
				}
				else
				{
					echo $html->link(__('Enable', true), array('action'=>'../cde_modules/enable', $cdeModule['CdeModule']['id']));
				}
			?>
		</td>
	</tr>
<?php endforeach; ?>
</table>
<div class="actions">
	<?php echo $html->link(__('List all units', true), array('action'=>'index'));?>
</div>
